package com.woniu.server.service.impl;



import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.woniu.common.utils.ResponseData;
import com.woniu.server.dto.ProductInfoDto;
import com.woniu.server.mapper.ProjectProductMapper;
import com.woniu.server.pojo.ProjectProduct;
import com.woniu.server.service.ProjectProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author a
* @description 针对表【project_product(产品表)】的数据库操作Service实现
* @createDate 2024-11-22 09:37:04
*/
@Service
public class ProjectProductServiceImpl extends ServiceImpl<ProjectProductMapper, ProjectProduct>
    implements ProjectProductService {
    @Autowired
    private ProjectProductMapper productMapper;


    @Override
    public ResponseData<?> queryAllProduct() {
       List<ProductInfoDto> list = productMapper.queryAllProduct();
        return new ResponseData<>().ok(list);
    }

    @Override
    public ResponseData<?> queryProductByCode(String productCode) {
        ProductInfoDto one = productMapper.queryProductByCode(productCode);
        return new ResponseData<>().ok(one);
    }

    @Override
    public List<ProductInfoDto> queryAllProductList() {
        return  productMapper.queryAllProduct();
    }
}




